import { Errors as BaseErrors } from "maishu-toolkit/out/errors";

class Errors extends BaseErrors {
    compileError(filePath: string) {
        let error = new Error(`Compile error in file: ${filePath}`);
        error.name = Errors.prototype.compileError.name;
        return error;
    }
    pathNotExists(path: string) {
        let error = new Error(`Path not exists: ${path}`);
        error.name = Errors.prototype.pathNotExists.name;
        return error;
    }
    notAbsolutePath(path: string) {
        let error = new Error(`Path is not absolute: ${path}`);
        error.name = Errors.prototype.notAbsolutePath.name;
        return error;
    }
    invalidBabelConfigExtension(extension: string, configPath: string) {
        let error = new Error(`Invalid babel config file extension: ${extension}, babel config file path: ${configPath}.`);
        error.name = Errors.prototype.invalidBabelConfigExtension.name;
        return error;
    }
}

export const errors = new Errors();